package cn.iocoder.yudao.framework.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import javax.annotation.Nonnull;

@AllArgsConstructor
@Getter
public enum StatusEnum {
    ENABLE(0, "正常"),
    DISABLE(1, "禁用"),
    UNKNOWN(-1, "未知");

    private final Integer status;

    private final String desc;

    @Nonnull
    public static String getStatus(Integer status) {
        for (StatusEnum se : StatusEnum.values()) {
            if (se.getStatus().equals(status)) {
                return se.getDesc();
            }
        }
        return UNKNOWN.desc;
    }

}
